Repository navigation
fix(lint)!: three publish-time checks for seeds, flow nodes and actions that save and do not work - #37807
Conversation
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
…ecks Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
…eds-actions-checks
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
…task Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
…declares the showcase package Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
…ure; pin it Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
…empty object set without a closure The runtime seed save door already refuses a seed over an object nothing resolves (#34864), with the draft and publish-promotion carve-outs a snapshot of served objects cannot see, so the ladder stays off the seed door. An empty object set with no closure in force is no universe (#24668), as at the list-view member. Two closure-scoped protocol fixtures serve the objects their actions and flow nodes bind. Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
… brought to the action and flow-node checks An authored package that binds the host package's object declares the host; the conformance engines register the object their advisory flow deletes from; the orphan-action pin now reads the refusal its save meets. Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 50 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 17 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 188 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 59cb1d10ce35f69d5a4b17de0e7802972156f5d2 && git checkout 59cb1d10ce35f69d5a4b17de0e7802972156f5d2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 02ed8408450291fd22777fe9ba51a9ec9fcc9135 d2a38064eaaf69041dfa336855c26866c6f88c38 && git checkout -B drift-repro 02ed8408450291fd22777fe9ba51a9ec9fcc9135 && git merge --no-ff d2a38064eaaf69041dfa336855c26866c6f88c38
node scripts/docs-audit/affected-docs.mjs --json 02ed8408450291fd22777fe9ba51a9ec9fcc9135
|
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK Contract reviewServed-tier: Face: the file list (31 paths) holds one published-schema path (the ADR-0087 entry, first on the Scope line), and the PR body and the changeset both declare The PR's three lines are called line 1 (seed keys), line 2 (object bindings) and line 3 (write grant) here, so that they are not confused with the finding ids. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentAgainst card #35143, Seeds and actions family only. M1 (must-fix) — on the CLI the flow-node site refuses a binding to a declared dependency's object, which a build cannot see and the published contract says is not refused there.
S1 (should-fix) —
S2 (should-fix) — line 1 refuses
Is a regex the right instrument for line 3 at a publish gate: yes, as an error.
Nits, none with an effect on correctness or the contract:
Open at this head: M1, S1, S2. Each earns a delta read of its fix by this reviewer. Implemented-by: VERDICT: FAIL |
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK 席位核对 — REVISE · repo:objectstack#6 · head
|
…engine's provisioned seed columns; explain both new ids M1: with no closure and no whole collection a dependency the build cannot see may define a flow node's object, so the miss is a warning there and an error at the publish door, as flow-trigger-unknown-object splits it. S2: a seed key the engine's insert door accepts (id, created_at, updated_at on every table) is admitted, and an object with no field map is not judged. N2: os explain entries for seed-record-unknown-field and action-body-write-capability-undeclared, whose ids the barrel now exports. Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
…and a nested object argument S1: every write shape the publish check reads is now inferred when os build lowers a handler, so the build does not refuse a handler it just lowered. Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK Contract reviewServed-tier: Delta round by the reviewer of record 7209862537 (FAIL at ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentFindings of record 7209862537, re-judged at this head: M1 (must-fix): closed.
S1 (should-fix): closed.
S2 (should-fix): closed.
New at this head: S3 (should-fix) — the declaration line is
Nits, none with an effect on correctness or the contract:
Open at this head: S3. No must-fix. Implemented-by: VERDICT: PASS |
…t now exports two rule-id constants Contract review 7211486008 S3: the two added exports enlarge the published surface. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK Contract reviewServed-tier: Delta round by the reviewer of record 7211486008 (PASS at ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentFindings of the earlier records, at this head: M1 (must-fix): closed.
Nits, none with an effect on correctness or the contract, unchanged from 7211486008:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK 维护者速读
席位意见:契约审核第一轮未过(1 必改 2 应改),返工后全部关闭,又补正了一处声明行;CI 全绿;剩余小问题立卡 #37838,相关后续 #37814、#37815。建议批准。 席位核对 — ACCEPT · repo:objectstack#6 · head
|
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK Review requested: this narrowing PR ( Records at head
After merge the seat releases #35143 back to |
…eds-actions-checks
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK Contract reviewServed-tier: Delta round by the reviewer of records 7211531167 (PASS at ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentFindings of the earlier records, at this head: M1 (must-fix): closed. Nits, none with an effect on correctness or the contract, unchanged from 7211531167:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK 席位核对 — ACCEPT · repo:objectstack#6 · head
|
Part of #35143
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37814
维护者速读
What changes
The Seeds and actions family of the card's second batch of publish-time checks, three lines, each verified on
origin/mainfirst (probe configs underexamples/app-todo, removed afterwards).data: [{ object, records }]entry and for aseedsaved at the runtime door:os validatepassed a misspelt key and the runtime gate dispatched nothing forseed.defineSeedalready refused it when it ran.seed-record-unknown-fielddefineStackrefuses an unprefixed miss on the CLI, and the runtime save door already refuses a seed over an object neither the registry nor a draft answers for (#34864, pinned inprotocol.seed-external-id-refusal.test.ts); a platform-prefixedsys_nothing_hereseed built clean. An action:defineStackrefuses a missingobjectNameon the CLI; the runtimeactiondoor judged nothing. A flowcreate_recordnode topr_nopepassed everywhereobject-reference-unknownladder (validateObjectReferences) to the three bindings, as the card asks; no second rule. The seed binding is judged on the CLI only: the runtime seed door stays with #34864ctx.api.object(…).update(…)withcapabilities: []passed. The declaration key exists (body.capabilities, enumHookBodyCapability,api.write), so the line was not stoppedaction-body-write-capability-undeclaredpackages/lint/src/validate-seed-record-keys.ts). The column set is the object's fields as served, including fields an object extension adds, plus the system columns the platform injects on that object (injectedColumnsFor). So an object built withsystemFields: falseis refusedcreated_at, exactly asdefineSeedrefuses it.columnskeys are both judged. A key is reported once per dataset.seeddoor.validate-object-references.ts). New sites:object(CLI only, see below);config.objectNameonget_record/create_record/update_record/delete_recordand object-formscreennodes, nested nodes included;objectName.object-reference-unregistered-platform.actiondoor as well. The suite entry dispatches onaction, but only the member that declares the type runs. It does not run on theseeddoor: Seed: the runtime save door accepts a seed whoseobjectnames no object, and the publish probe then tells the author to "Publish again" #34864's save-door refusal already answers it there, accepting a draft of the object in the same package and leaving the publish promotion and restore doors to the load. A snapshot of served objects cannot reproduce those carve-outs, so a second verdict there would contradict them. Found by the metadata-protocol suite and corrected in e5a226a.validateListViewFieldRefsskips it and no other rule judges aviewwrite's binding #24668): a host that hands over no objects supplied no universe. Under a closure an empty set is still a verdict (A list view bound to an object outside the writing package's dependency closure skips the field-reference check: unknowncolumnsfields are accepted (200 active, draft → publish) where the same body is refused 422list-view-field-unknown#24563). Both directions are pinned.?package=) is judged against that package's closure, as a flow saved there already was. An object another package owns resolves only when the manifest declares that package independencies. Three fixtures (one dogfood, one runtime, one protocol) had an authored package bind another package's object without declaring it, and each now declares the dependency. This is the part of the change most likely to meet a real author; see Acceptance notes.validate-action-body-capabilities.ts). The write set is the sandbox runner'sWRITElist (insert,update,delete,updateMany,deleteMany,upsert). A test pins it againstquickjs-runner.ts.ctx.apidirect,const api = ctx.api(or its destructured form) bound once, and a handleconst repo = ctx.api.object(…).actionandobjectdoors.ScriptCapabilitiesFieldlets the author tickapi.write.os buildlowers a handler throughextract-hook-body.ts, which infers the grant. Measured: a handler whose only write wasupdateManyordeleteManyinferred no grant, so it was lowered into exactly the shape S3 refuses.packages/cli, commit ee0969c), with a two-caseit.eachpin.Commits outside the claim's
packages/lintsurfacefix(cli): the extractor's write regex, named above (packages/cli/src/utils/extract-hook-body.tsplus its test).docs: the rule count 81 → 83 on four pages, and thevalidating-metadata.mdxrows (two new, two extended).chore: the changeset and the upgrade-guide entrypackages/spec/src/migrations/entries/semantic/19.publish-refuses-seeds-and-actions-that-save-and-do-not-work.ts(notice only, no conversion).chore:turbo.jsonandscripts/cross-package-test-inputs.mjsdeclarepackages/runtime/src/sandbox/quickjs-runner.tsas an input of the lint test task, which reads it (check:cross-package-test-inputswent red without it).test: the fixtures named above, inpackages/qa/dogfood,packages/runtimeandpackages/objectql. The objectql orphan-action pin is the one whose FROM this PR changes: the save is now refused 422.packages/metadata-protocolfixtures that save under a package closure, so that they serve the objects their actions and flow nodes bind.origin/main. It touched nothing underpackages/lint.Rework after contract review 7209862537 (head
6361589d)object-reference-unknownis a warning when no closure and no whole collection is stated (the CLI case: a binding to a dependency's object the build cannot see), and an error at the publish door, asflow-trigger-unknown-objectsplits. The changeset, the ADR-0087 entry, the explanation and the docs row no longer claim the step "fails the run on every execution" unconditionally.os buildextractor infersapi.writethrough a bound handle,?.before the leaf, and an.object(...)argument holding a call; pinned shape by shape; the rule header names the shapes.seed-record-unknown-fieldadmitsid/created_at/updated_at(the engine's provisioned columns, pinned to the objectql source) and gives the engine's door as the reason.os explainentries for both new ids;@objectstack/lintnow exports the two rule-id constants (and only those) so the explanation table can carry them.updateByIdadvice, ADR-0141 D1 binding list). Skills follow-up: skills: objectstack-ui actions rule teaches the api.write grant as prose; the trap is now refused at validate and publish (after #37807) #37814.Tests
validate-seed-record-keys.test.ts,validate-action-body-capabilities.test.ts(19 scanner shapes, write set pinned to the runner), and a[#35143]block invalidate-object-references.test.ts. Each rule has a positive and a negative pin through the registry and at the runtime door.runtime-gate.inert-type-writes.test.ts: anactionwrite now reaches onlyvalidateObjectReferencesfrom the suite; ahookwrite still dispatches nothing.runtime-gate.object-writes.test.ts: the object-door rosters.runtime-lazy-deps.test.ts: the action leg, with no parser loaded.git checkout HEAD:api.writeskip): four tests go red.Readings at head a683a7d
Scoped suites (all at a683a7d or at e5a226a, whose lint and metadata-protocol sources a683a7d does not change)
@objectstack/lint, whole package: Test Files 241/241, Tests 9760/9760. The three new or extended files: 3/3, 114/114 at a683a7d.@objectstack/metadata-protocol, whole package: Test Files 371 passed + 9 skipped, Tests 23450 passed + 45 skipped. Before the fixes it read 84 failed across 8 files, every oneobject-reference-unknown.@objectstack/cli: the extractor test plusmigrate-meta-engine-guidance63/63; theunittier 446/446 files, 6395/6395 tests. Theintegrationtier is left to CI.@objectstack/objectql: whole package 6 failed before the fixtures (allobject-reference-unknown); the four touched files 68/68 after.@objectstack/runtime: whole package 1 failed before the fixture (object-reference-unknown); the touched file 2/2 after.@objectstack/mcp1589/1589,@objectstack/plugin-approvals1966/1966,@objectstack/example-showcase554/554.lint,objectql,runtime,metadata-protocol,dogfood,cli. The test layers compile undertsconfig.test.json. It caught a stray gate-input key in three new lint tests, fixed in 72b7cec.Dogfood battery (the PR narrows)
VERDICT command-exit 0, Test Files 490 passed + 3 skipped (493), Tests 4144 passed + 68 skipped (4212).action-save-packageless-other-object.dogfood.test.ts. Its package bound an action to a showcase object without declaring the showcase package. Fixed in 04d056b; the battery above is the rerun on the final head.Derived gates (dispatch-gates at a683a7d)
node scripts/check-plugin-teardown-shape.mjs --self-testexits 3 because its positive control is pinned to a commit this shallow clone cannot reach. It is a checker-health self-test.--ranreconciliation: 141 accounted for, 0 unrun.check:cross-package-test-inputswas red at 4ba19b7 and is green at head (0a916bb).check-nul-bytesOK.check-platform-checklist --changed-from origin/mainOK (4 anchors judged, 0 lost).Acceptance notes
os validateandos buildonapp-crm,app-multi-package,app-starter,app-todoandapp-showcaseall exit 0 with "Running author-time rules (83)" and no new finding.api.write; its 45 flows bind only declared or platform-provided objects; its seeds usedefineSeed.create-objectstacktemplate is not affected.flow-trigger-unknown-objectstays a warning. The divergence is noted here, not changed.actionwrite is now also judged for its params'reference/objectOverrideobjects, asos validatealready judged them. The changeset says so.body.capabilitieson a hook has the same gap);ctx.api.transactionwithoutapi.transaction;updateByIdis not installed by the sandbox, yet lint'sAPI_WRITE_METHODSgrades it, and theaction-record-write-discardedhint recommendsctx.api.object(…).updateById(…). Reported for the seat to measure; not touched here.Verification
Two-minute check:
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-seed-record-keys.test.ts src/validate-action-body-capabilities.test.ts src/validate-object-references.test.tsExpect
Test Files 3 passed (3)andTests 114 passed (114).Read first, by risk:
packages/lint/src/validate-action-body-capabilities.ts: the masked regex scanner. A false positive here refuses a publish. The hunk to read isbodyApiWriteCallsand its alias /boundOncehandling.packages/lint/src/authoring-rules.tswithreference-integrity-suite.ts: the suite entry now dispatches onseedandaction. The hunk to read is theruntimeTypeswidening and the member filter it relies on.packages/lint/src/validate-object-references.ts: the new binding block. The hunk to read is theextendedexemption and the flow-node type list.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK